package com.lh.marketing.canvas.enums;

/**
 * 字段类型
 */
public enum PropertyTypeEnum {

    number(0,"数字类型"),
    time(1,"时间类型"),
    string(2,"字符串类型");

    public final Integer type;

    public final String remark;

    PropertyTypeEnum(Integer type, String...remarks) {
        this.type = type;
        this.remark = remarks.length>0?remarks[0]:"";
    }

    public static PropertyTypeEnum getByType(Integer type){
        if(type == null){
            return string;
        }
        for (PropertyTypeEnum pe : PropertyTypeEnum.values()) {
            if (pe.type.equals(type)) {
                return pe;
            }
        }
        return string;
    }
}
